/**
 * Squares
 * @author Vincent Dominguez
 * 
 * Classes that represent cells in the game grid
 */

package com.vmd.MSFlags;

class Square {
	protected boolean mFlipped;
	
	public Square() {
		mFlipped = false;
		//mFlipped = true;
	}
	
	public void flip() {
		mFlipped = true;
	}
	
	public boolean isFlipped() {
		return mFlipped;
	}
}

class RegularSquare extends Square {
	private int mNumAdjacent;

	public void setmNumAdjacent(int mNumAdjacent) {
		this.mNumAdjacent = mNumAdjacent;
	}
	
	public int getmNumAdjacent() {
		return mNumAdjacent;
	}
	
	public void incmNumAdjacent() {
		mNumAdjacent++;
	}
	
	@Override
	public String toString() {
		return (mFlipped && (mNumAdjacent > 0)) ? " "  + mNumAdjacent + " ": "    ";
	}
}

class FlagSquare extends Square {
	@Override
	public String toString() {
		return mFlipped ? " X " : "    ";
	}
}